home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 9 / Amoszine 9 (Disk 3 of 3).adf / Steves_ALister_Source.lha / alisterv4.amos / alisterv4.amosSourceCode
AMOS Source Code  |  1992-03-06  |  2KB  |  83 lines

  1. 'ALister Steve Bye, Aug 95 
  2.  
  3. 'This snippet takes the ASCII text files that the Aminet Amos List 
  4. 'distributes and cuts out all the crap in between messages.
  5. 'I enjoy reading the messages but it gets very tedious scrolling past 100s 
  6. 'of k of crap. 
  7.  
  8. 'I would be happy to see improvements made to this, I can't
  9. 'be bothered as it does what I need it to and was only a 10 min
  10. 'jobbie. Send it in to AZ so I can see it though.
  11.  
  12.  
  13. 'bank 11 is used as a temp storage place 
  14. Reserve As Data 11,100000
  15.  
  16. 'get the Amos List file & load it in bank 10 
  17. F$=Fsel$("")
  18. Open In 1,F$
  19. L=Lof(1)
  20. Reserve As Data 10,L
  21. Close 1
  22. Bload F$,10
  23.  
  24.  
  25. MARKER=0
  26. COUNT=Start(10)
  27.  
  28.  
  29. Do 
  30. 'search for end of junk marker, this varies from list to list
  31. 'so change it if need be 
  32.  
  33. S$="Status: RO"
  34. ADR=Hunt(COUNT To Start(10)+Length(10),S$)
  35. COUNT=ADR+10
  36.  
  37. 'found junk string 
  38. If ADR>0
  39. Inc HC : Print "Found start mess ";HC;"  at ";ADR-Start(10)
  40.  
  41. 'so look for next junk beginning string, same applies as above.
  42. S$="From amos-request"
  43. ADRF=Hunt(ADR+10 To Start(10)+Length(10),S$)
  44. If ADRF>0
  45. Inc ND
  46. Print "found end mess ";ND;"  at ";ADRF-Start(10)
  47.  
  48. 'we are here so must of found marker 
  49. 'now cut out the meat, the text we want with no crap.  
  50. 'using Copy caused me probs by the way, this is fast enough though.
  51. 'Copy the text from 10 into bank 11. 
  52. For Z=ADR+10 To ADRF
  53. Poke Start(11)+MARKER,Peek(Z)
  54. Inc MARKER
  55. Next Z
  56.  
  57. 'check if bank 11 is nearly full 
  58. 'If IT IS Save IT OUT
  59. If MARKER>90000
  60. Inc P
  61. Gosub _SAVE
  62. End If 
  63.  
  64. End If 
  65. End If 
  66.  
  67. 'It's all over dudes so save what is left
  68. If ADR<=0
  69. Inc P
  70. Bsave F$+Str$(P),Start(11) To Start(11)+MARKER
  71. Erase 10
  72. Erase 11
  73.  
  74. Stop 
  75. End If 
  76. Loop 
  77.  
  78. _SAVE:
  79. Bsave F$+Str$(P),Start(11) To Start(11)+MARKER
  80. Erase 11
  81. Reserve As Data 11,100000
  82. MARKER=0
  83. Return